# {{ ansible_managed }}

{% block main %}
{% for port in sshd_ports %}
Port {{ port }}
{% endfor -%}

AddressFamily {{ sshd_address_family }}

{% for address in sshd_listen_addresses %}
ListenAddress {{ address }}
{% endfor -%}

Protocol {{ sshd_protocol }}

{% if sshd_accept_env | count %}
  AcceptEnv {{ sshd_accept_env | join(' ') }}
{% endif -%}
AllowAgentForwarding {{ sshd_allow_agent_forwarding | ternary('yes', 'no') }}
AllowTcpForwarding {{ sshd_allow_tcp_forwarding is string | ternary(sshd_allow_tcp_forwarding, sshd_allow_tcp_forwarding | ternary('yes', 'no')) }}
ChallengeResponseAuthentication {{ sshd_challenge_response_authentication | ternary('yes', 'no') }}
Ciphers {{ (sshd_ciphers_default + sshd_ciphers_extra) | join(',') }}
ClientAliveInterval {{ sshd_client_alive_interval }}
DebianBanner {{ sshd_debian_banner | ternary('yes', 'no') }}
{% for key in sshd_host_keys %}
HostKey {{ key }}
{% endfor %}
KexAlgorithms {{ (sshd_kex_algorithms_default + sshd_kex_algorithms_extra) | join(',') }}
LoginGraceTime {{ sshd_login_grace_time }}
MACs {{ (sshd_macs_default + sshd_macs_extra) | join(',') }}
PasswordAuthentication {{ sshd_password_authentication | ternary('yes', 'no') }}
PermitRootLogin {{ sshd_permit_root_login | ternary('yes', 'no') }}
PrintLastLog {{ sshd_print_last_log | ternary('yes', 'no') }}
PrintMotd {{ sshd_print_motd | ternary('yes', 'no') }}
Subsystem {{ sshd_subsystem }}
TCPKeepAlive {{ sshd_tcp_keep_alive | ternary('yes', 'no') }}
UsePAM {{ sshd_use_pam | ternary('yes', 'no') }}
X11Forwarding {{ sshd_x11_forwarding | ternary('yes', 'no') }}
{% endblock %}
